package com.example.eureka.client.eurekaclient.controller;

import com.example.eureka.client.eurekaclient.entity.LaCode;
import com.example.eureka.client.eurekaclient.service.LaCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DearController {
    @Autowired
    private LaCodeService laCodeService;

    @RequestMapping("/info")
    public String dear(){
        return "dear xxx，this is demo-client1 messge";
    }

    @RequestMapping("/producerDear")
    public String dear(@RequestParam("name") String name){
        List<LaCode> list = laCodeService.findByLaCode("11");
        System.out.println("list-size"+list.size());
        System.out.println(list.get(0).getLaCode());
        return "dear " + name + "，this is demo-client1 messge";
    }


}
